home *** CD-ROM | disk | FTP | other *** search
- Path: news.connect.net!usenet
- From: tomw@intelligraphics.com
- Newsgroups: comp.lang.c++
- Subject: Re: Memory allocation.
- Date: 11 Feb 1996 22:50:43 GMT
- Organization: Connection Technologies
- Message-ID: <4flrs3$a9m@dallas1.connect.net>
- References: <1996Feb10.161530.26449@wisipc.weizmann.ac.il>
- Reply-To: tomw@intelligraphics.com
- NNTP-Posting-Host: igxtest.intelligraphics.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <1996Feb10.161530.26449@wisipc.weizmann.ac.il>, Kajdan Dimitry <cerlpvk> writes:
- >I'm a starter so the question may seem stupid.
- >
- >Would someone explain why this program works?
-
- Pure luck. It just so happens that the stack hasn't been overwritten
- with anything else. If you were to call other functions, that stack space
- would get trashed and the cout<<x[2]<<endl would no longer print the
- expected answer.
-
- +---------------------------------------------------------------------------+
- + Tom Wheeler | Member NRA, NMRA +
- + tomw@intelligraphics.com | OS/2 user, C++ programmer +
- + ------------------------------------------------------------------------- +
- + Postmodernism is the refusal to think. Deconstructionism is the refusal +
- + to believe that anyone else can either. +
- +---------------------------------------------------------------------------+
- + Use or reproduction of this document or the author's email address for +
- + commercial purposes without the author's permission is prohibited. +
- +---------------------------------------------------------------------------+
-
-